package de.game.graph;

public class EdgeImpl implements Edge{

	
	private String name = "";
	private int id = -1;
	private float weight;
	private Node start;
	private Node end;
	
	
	public EdgeImpl(){
		
	}
	
	
	public EdgeImpl(String name, int id, float weight){
		this.name = name;
		this.id = id;
		this.weight = weight;
	}
	
	
	@Override
	public EdgeImpl createEdge(String name, int ID, float weight) {
		return new EdgeImpl(name, ID, weight);
	}

	
	
	@Override
	public Node getStartNode() {
		return start;
	}

	@Override
	public void setStartNode(Node n) {
		start = n;
		
	}

	@Override
	public Node getEndNode() {
		return end;
	}

	@Override
	public void setEndNode(Node n) {
		end = n;
		
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public int getID() {
		return id;
	}

	@Override
	public float getWeight() {
		return weight;
	}

	
	public String toString(){
		return ("The name of this Edge is "+ this.getName()+ " and its ID is "+ this.getID()+ "\n " +
				"Its StartNode is "+this.getStartNode().getName()+ " and his EndNode is"+ this.getEndNode().getName()+ "\n " +
						"with a weight of " + this.getWeight());
	}
	
	
	
}
